<?php

namespace app\admin\controller\print_md;

use think\admin\Controller;
class PrintMd extends Controller
{
    public function print(){
        if($this->request->isPost()){
            $post = $this->request->post();
            $this->_vali(['kd100_appkey.require' => '参数不能为空！']);
            $this->_vali(['kd100_secret.require' => '参数不能为空！']);
            $this->_vali(['kd100_customer.require' => '参数不能为空！']);
            sysconf('kd100_appkey',$post['kd100_appkey']);
            sysconf('kd100_appsecrety',$post['kd100_secret']);
            sysconf('kd100_customer',$post['kd100_customer']);
            $this->success('保存成功');
        }else{
            $this->title = '快递100参数配置';
            $this->config = [
                'kd100_appkey' => sysconf('kd100_appkey'),
                'kd100_appsecrety' => sysconf('kd100_appsecrety'),
                'kd100_customer' => sysconf('kd100_customer'),
            ];
        }
        $this->fetch();
    }
}
